package com.klikmee.sms.core.base.postman;

import java.util.Date;

import com.klikmee.sms.core.model.IncomingMessage;
import com.klikmee.sms.core.model.OutgoingMessage;
import com.klikmee.sms.core.model.Service;

public interface ServiceMessageDeliverer {
	
	/**
	 * This method forwards incoming message to service. 
	 * @param outgoingMessage message to be delivered
	 * @return true if operation is successful, false otherwise
	 * @throws InvalidServiceUrlException 
	 */
	boolean deliverMessage(IncomingMessage outgoingMessage) throws InvalidServiceUrlException;
	/**
	 * Forwards delivery report to service instance. It uses om.Service ref to retreive service endpoint
	 * and om.DeliveryStatus to notify sending result.
	 * @param outgoingMessage obj containing delivery inforamtion.
	 * @return true if operation is successful, false otherwise
	 * @throws InvalidServiceUrlException 
	 */
	boolean forwardDeliveryReport(OutgoingMessage outgoingMessage) throws InvalidServiceUrlException;
	/**
	 * Forwards MTS subsctiption info to service instance.
	 * @param service service object representing instance of service to forward subscription.
	 * @param distributionListId name of distribution list
	 * @param msisdn user's phone number in format 3816..
	 * @param validTo date until which this subscription is valid
	 * @return true if operation is successful, false otherwise
	 */
	boolean forwardSubscripitonRequest(Service service, String distributionListId, String msisdn, Date validTo);
}
